package com.dzjcloud.dzj.upms.biz.controller.sys;

import com.dzjcloud.dzj.common.core.constant.CommonConstants;
import com.dzjcloud.dzj.common.core.utils.R;
import com.dzjcloud.dzj.upms.api.form.UpdateUserPasswrodForm;
import com.dzjcloud.dzj.upms.api.form.UserRegisteredForm;
import com.dzjcloud.dzj.upms.biz.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <h3>dzj-cloud</h3>
 * <p>用户前端控制器</p>
 *
 * @author : DongZeJian
 * @date : 2021-06-01 11:09
 **/
@RestController
@Api(tags = "用户权限控制前端控制器",value = "用户权限控制前端控制器")
@RequestMapping(CommonConstants.SYS+"/user")
@Slf4j
@Validated
@RequiredArgsConstructor
public class SysUserController {

    private final UserService userService;

    @ApiOperation("用户注册")
    @PostMapping("/registered")
    public R<Boolean> registered(@RequestBody @Valid UserRegisteredForm userRegisteredForm){
        return R.ok(userService.registered(userRegisteredForm));
    }
}
